<template>
	<uv-navbar :placeholder="true" :fixed="true" :title="title" left-arrow @leftClick="$onClickLeft" />

	<view calss="base-message">
		<uv-cell-group>
			<uv-cell title="电站ID：" :value="detailData.stationId"></uv-cell>
			<uv-cell title="充电桩ID：" :value="detailData.id"></uv-cell>
			<uv-cell title="网络端口：" :value="detailData.port"></uv-cell>
			<uv-cell title="设备状态：" :value="statusMap[detailData.deviceStatus]"></uv-cell>
			<uv-cell title="电流：" :value="detailData.deviceCurrent"></uv-cell>
			<uv-cell title="功率：" :value="detailData.devicePower"></uv-cell>
			<uv-cell title="当前充电时间：" :value="detailData.currentTimes"></uv-cell>
			<uv-cell title="累计时间(时)：" :value="detailData.hours"></uv-cell>
			<uv-cell title="使用度数累计：" :value="detailData.usedDegree"></uv-cell>
			<uv-cell title="充电桩单价：" :value="detailData.deviceCost"></uv-cell>
			<uv-cell title="终端号：" :value="detailData.code"></uv-cell>
			<uv-cell title="充电桩IP：" :value="detailData.ip"></uv-cell>
			<uv-cell title="接口类型：" :value="detailData.deviceInterface"></uv-cell>
			<uv-cell title="设备类型：" :value="detailData.deviceType"></uv-cell>
			<uv-cell title="电压：" :value="detailData.deviceVoltage"></uv-cell>
			<uv-cell title="电池百分比：" :value="detailData.soc"></uv-cell>
			<uv-cell title="当前充电时长(毫秒)：" :value="detailData.lastTime"></uv-cell>
			<uv-cell title="使用次数：" :value="detailData.useNum"></uv-cell>
			<uv-cell title="使用时间累计：" :value="detailData.usedTimes"></uv-cell>
			<uv-cell title="客服电话：" :value="detailData.kefuMobile"></uv-cell>
		</uv-cell-group>

	</view>

</template>

<script setup>
	import {
		reactive,
		ref
	} from "vue"
	import {
		onLoad
	} from "@dcloudio/uni-app"
	import {
		reqChargeDetail
	} from "@/api/model/chargingStation"
	const title = ref('详情')
	const statusMap = {
		'-1': '未上线',
		0: '空闲',
		1: '车桩相连',
		2: '充电中',
		4: '故障',
	}
	const detailData = ref({

	})

	const getDetail = async (id) => {
		let {
			data
		} = await reqChargeDetail(id)
		console.log("详情数据", data)
		detailData.value = data.data
	}

	onLoad((option) => {
		console.log("接受参数", option)
		getDetail(option.detailId)
	})
</script>

<style>
</style>